package com.example.demo.controller;

import com.example.demo.entity.Artical;
import com.example.demo.service.MeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@CrossOrigin
@Controller
public class Mecontroller {
    @Autowired
    MeService meService;

    @PostMapping("/updateme")
    @ResponseBody
    public Map<String,Object> gengxin(Artical artical){
        Map<String,Object> map = new HashMap();
        int update = meService.updateme(artical);
        map.put("code", 0);
        map.put("msg", "更新成功！");
        map.put("count", 1);
        map.put("data", update);
        return map;
    }
}
